package cn.dkdoo.mongodb.repository;

import cn.dkdoo.bean.entity.TestTraUser;
import cn.dkdoo.mongodb.config.MongodbConfig;
import cn.dkdoo.utils.annotation.DkdTransactional;
import cn.dkdoo.utils.templateCommon.mongo.DkdMongoTemplate;
import cn.dkdoo.utils.templateDefault.mongo.DefaultMongoTemplate;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author nicky
 * @date 2021/5/12 下午2:29
 */
@DkdTransactional
@Component
public class MongodbTemplateRepository extends DkdMongoTemplate<TestTraUser> {
    @Resource(name = MongodbConfig.defaultMongoTemplate)
    DefaultMongoTemplate dkdMongoTemplate;

    @Override
    public MongoOperations initTemplate() {
        return dkdMongoTemplate;
    }

    @Override
    public Class<TestTraUser> initBeanClass() {
        return TestTraUser.class;
    }

}
